//高拍仪接口加载
// import {Cam_ControlInit,SelectDevice,SetCameraCutMode,TakePhoto,GetCaptrueImgResultCB} from './api/GPY/gpyhs.js';
// Vue.prototype.$gpy_init = Cam_ControlInit; //初始化
// Vue.prototype.$gpy_change_dev = SelectDevice; //切换设备
// Vue.prototype.$gpy_caiqie = SetCameraCutMode; //裁切模式
// Vue.prototype.$gpy_getPic = TakePhoto; //拍照
// Vue.prototype.$gpy_getBase64 = GetCaptrueImgResultCB; //获取到base64


import Vue from 'vue'
import Cookies from 'js-cookie'

import 'normalize.css/normalize.css' // a modern alternative to CSS resets

import Element from 'element-ui'
import './styles/element-variables.scss'

import '@/styles/index.scss' // global css
import '@/styles/common.css' // global css
import '@/styles/transition.css' // global css

import VideoPlayer from 'vue-video-player'
import hls from 'videojs-contrib-hls'
import 'videojs-flash'
Vue.use(VideoPlayer)
Vue.use(hls)

import App from './App'
import store from './store'
import router from './router'

import './icons' // icon
import './permission' // permission control
import './utils/error-log' // error log


import axios from 'axios'
Vue.prototype.$http = axios

import VueAMap from 'vue-amap'
Vue.use(VueAMap)
VueAMap.initAMapApiLoader({
	key: '32281fbe382d46c25c75691e5aa1d26e',
	plugin: ['AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PlaceSearch', 'AMap.Geolocation',
		'AMap.Geocoder'
	],
	v: '1.4.4',
	uiVersion: '1.0'
})

Vue.use(Element, {
	size: Cookies.get('size') || 'medium', // set element-ui default size
})

const echarts = require('echarts/lib/echarts')
require('echarts/lib/chart/line')
require('echarts/lib/chart/bar')
require('echarts/lib/chart/pie')
require('echarts/lib/chart/radar')

// 引入提示框和title组件，图例
require('echarts/lib/component/tooltip')
require('echarts/lib/component/title')
require('echarts/lib/component/legend')
require('echarts/lib/component/legendScroll') // 图例翻译滚动

Vue.prototype.$echarts = echarts

Vue.config.productionTip = false

//排序
function compare(property) {
	return function(a, b) {
		var value1 = a[property];
		var value2 = b[property];
		return value1 - value2;
	}
}
Vue.prototype.$compare = compare

new Vue({
	el: '#app',
	router,
	store,
	render: h => h(App)
})
